/*项目考勤管理*/
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:frametrim/activity/projectAttendanceManagementDetailPage.dart';
import 'package:frametrim/activity/text.dart';
import 'package:frametrim/app/app_navigator.dart';
import 'package:frametrim/utility/screen.dart';
import 'package:frametrim/utility/sq_color.dart';
import 'package:frametrim/views/appbar_black.dart';
import 'package:frametrim/views/button_round.dart';

class ProjectAttendanceManagementPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => ProjectAttendanceManagementState();
}

class ProjectAttendanceManagementState
    extends State<ProjectAttendanceManagementPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: AnnotatedRegion(
        value: SystemUiOverlayStyle.dark,
        child: Stack(
          children: [
            Image.asset('image/background.png',
                fit: BoxFit.cover, width: Screen.width, height: Screen.height),
            Column(
              children: <Widget>[
                AppbarCenterTitle(
                  title: '项目考勤管理',
                  imgStr: 'image/imv_back.png',
                  titleColor: SQColor.black,
                ),
                Expanded(
                    child: MediaQuery.removePadding(
                  context: context,
                  child: ListView.builder(
                    itemBuilder: (conttext, index) {
                      return buildItemView();
                    },
                    itemCount: 3,
                  ),
                  removeTop: true,
                ))
              ],
            ),
          ],
        ),
      ),
    );
  }

  Widget buildItemView() {
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: () {
        AppNavigator.push(context, PriojectAttendanceMDPage());
      },
      child: Container(
        margin: EdgeInsets.only(left: 10, right: 10, bottom: 10),
        padding: EdgeInsets.symmetric(vertical: 15, horizontal: 20),
        decoration: ShapeDecoration(
            color: Colors.white,
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(5)))),
        child: Column(
          children: [
            Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Container(
                  width: 3,
                  height: 18,
                  decoration: ShapeDecoration(
                      color: SQColor.primary,
                      shape: RoundedRectangleBorder(
                          borderRadius: BorderRadius.all(Radius.circular(5)))),
                ),
                SizedBox(
                  width: 10,
                ),
                Text(
                  '二七华侨城',
                  style: TextStyle(fontSize: 20, color: SQColor.color_222222),
                )
              ],
            ),
            SizedBox(
              height: 15,
            ),
            Row(
              children: [
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      '856',
                      style:
                          TextStyle(fontSize: 20, color: SQColor.color_222222),
                    ),
                    Text(
                      '总在场人数',
                      style:
                          TextStyle(fontSize: 14, color: SQColor.color_666666),
                    ),
                  ],
                ),
                Expanded(child: Container()),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      '589',
                      style:
                          TextStyle(fontSize: 20, color: SQColor.color_222222),
                    ),
                    Text(
                      '今日考勤人数',
                      style:
                          TextStyle(fontSize: 14, color: SQColor.color_666666),
                    ),
                  ],
                ),
                Expanded(child: Container()),
                Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: [
                    Text(
                      '55%',
                      style:
                          TextStyle(fontSize: 20, color: SQColor.color_222222),
                    ),
                    Text(
                      '今日出勤率',
                      style:
                          TextStyle(fontSize: 14, color: SQColor.color_666666),
                    ),
                  ],
                ),
              ],
            ),
            SizedBox(
              height: 15,
            ),
            Container(
              margin: EdgeInsets.only(bottom: 5),
              width: Screen.width,
              height: 40,
              child: ButtonRoundView(
                textStr: '进入项目',
                textColor: SQColor.color_0634DE,
                buttonColor: SQColor.color_DEE5FF,
                textSize: 16,
                onPress: () {
                  AppNavigator.push(context, PriojectAttendanceMDPage());
                },
              ),
            ),
          ],
        ),
      ),
    );
  }
}
